﻿/// <reference name="MicrosoftAjax.js"/>
var selected = true;
function TreeViewClientNodeClicking(sender, eventArgs) {
    var node = eventArgs.get_node();
    var value = node.get_selected();
    selected = value;

    var cssClass = node.get_cssClass();
    if (cssClass != null) {
        if (cssClass.match('NotAllowedParent') != null) {
            eventArgs.set_cancel(true);
            selected = true;
        }
    }

}
function TreeViewClientNodeClicked(sender, eventArgs) {
    var node = eventArgs.get_node();
    var treeview = node.get_treeView();
    var id = treeview._element.id;

    if (selected == true) {
        node.unselect()
        $get(id + '_title').innerHTML = 'None (Root)';
    } else {
        $get(id + '_title').innerHTML = node.get_text();
    }

}
function CancelTreeNodeClick(sender, eventArgs) {

    eventArgs.set_cancel(true);

}



